package model

// DbGmAccount 数据库账号表
type DbGmAccount struct {
	Id           uint32 `gorm:"column:id;type:int(11);primaryKey;autoIncrement"`
	Name         string `gorm:"column:name;type:varchar(255);not null"`
	Password     string `gorm:"column:password;type:varchar(32);not null"`
	Token        string `gorm:"column:token;type:varchar(32);index"`
	Role         string `gorm:"column:role;type:varchar(32);default:'admin'"` // 新增：角色
	Avatar       string `gorm:"column:avatar;type:varchar(500)"`              // 新增：头像URL
	Introduction string `gorm:"column:introduction;type:varchar(500)"`        // 新增：简介
	Age          int16  `gorm:"column:age;type:smallint(6)"`
	CreatedTime  int    `gorm:"column:createdTime;type:int(11)"`
}

func (a DbGmAccount) TableName() string {
	return "gm_account"
}

// DbGmAccountToken 数据库账号令牌表
type DbGmAccountToken struct {
	Token      string `gorm:"column:token;type:varchar(32);primaryKey"` // 令牌
	Uid        uint32 `gorm:"column:uid;type:bigint(20)"`               // uid
	CreateTime uint32 `gorm:"column:create_time;type:bigint(20)"`       // 创建时间
}

func (a DbGmAccountToken) TableName() string {
	return "gm_account_token"
}
